package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanhua.dubbo.mappers.SoulAppraiseMapper;
import com.tanhua.model.testpaper.SoulAppraise;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@DubboService
public class SoulAppraiseApiImpl implements SoulAppraiseApi{
    @Autowired
    private SoulAppraiseMapper soulAppraiseMapper;
    @Override
    public SoulAppraise findTitle(Double score) {
        LambdaQueryWrapper<SoulAppraise>lqw=new LambdaQueryWrapper<>();
        lqw.le(SoulAppraise::getMin,score);
        lqw.gt(SoulAppraise::getMax,score);
        SoulAppraise soulAppraise = soulAppraiseMapper.selectOne(lqw);
        log.info(soulAppraise.toString());
        return soulAppraise;
    }
}
